/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package qlvbdq.gui;

import java.awt.event.KeyEvent;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Nguyen Vu Huy
 */
public class pnlQLSP extends javax.swing.JPanel {

    /**
     * Creates new form pnlQLSP
     */
    public pnlQLSP() {
        initComponents();
        txtSoLuongNhap.setDocument(new JXTextFieldLimit(5));
        txtDonGiaMua.setDocument(new JXTextFieldLimit(10));
        txtSoLuongMua.setDocument(new JXTextFieldLimit(5));
        txtDonGiaBanQL.setDocument(new JXTextFieldLimit(10));
        txtDiaChi.setDocument(new JXTextFieldLimit(50));
        txtDiaChiNguonNhap.setDocument(new JXTextFieldLimit(50));
        txtKieuSanPhamQL.setDocument(new JXTextFieldLimit(50));
        txtNguonNhap.setDocument(new JXTextFieldLimit(50));
        txtTenKhach.setDocument(new JXTextFieldLimit(50));
        txtTenSPQL.setDocument(new JXTextFieldLimit(50));
        txtThongTinTraCuuPhieuMuaHang.setDocument(new JXTextFieldLimit(50));
        txtThongTinTraCuuSP.setDocument(new JXTextFieldLimit(50));
        txtDonGiaNhap.setDocument(new JXTextFieldLimit(10));
        txtMaKhach.setDocument(new JXTextFieldLimit(15));
        txtMaSanPhamMua.setDocument(new JXTextFieldLimit(15));
        txtMaSanPhamNhap.setDocument(new JXTextFieldLimit(15));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    
    private void ClearTextField(){
        txtDonGiaMua.setText("");
        txtDonGiaNhap.setText("");
        txtKieuSanPham.setText("");
        txtKieuSanPhamMua.setText("");
        txtLoaiSanPham.setText("");
        txtLoaiSanPhamMua.setText("");
        txtMaKhach.setText("");
        txtMaSanPhamMua.setText("");
        txtMaSanPhamNhap.setText("");
        txtSoLuongMua.setText("");
        txtSoLuongNhap.setText("");
        txtSoLuongTon.setText("");
        txtThanhTienMua.setText("");
        txtThanhTienNhap.setText("");
      
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jXPanel1 = new org.jdesktop.swingx.JXPanel();
        jXLabel1 = new org.jdesktop.swingx.JXLabel();
        jXLabel2 = new org.jdesktop.swingx.JXLabel();
        jXLabel3 = new org.jdesktop.swingx.JXLabel();
        dtpNgayNhap = new org.jdesktop.swingx.JXDatePicker();
        txtNguonNhap = new org.jdesktop.swingx.JXTextField();
        txtDiaChiNguonNhap = new org.jdesktop.swingx.JXTextField();
        jXLabel6 = new org.jdesktop.swingx.JXLabel();
        jXLabel7 = new org.jdesktop.swingx.JXLabel();
        jXLabel8 = new org.jdesktop.swingx.JXLabel();
        txtSoLuongNhap = new org.jdesktop.swingx.JXTextField();
        txtDonGiaNhap = new org.jdesktop.swingx.JXTextField();
        txtThanhTienNhap = new org.jdesktop.swingx.JXTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblNhapHang = new org.jdesktop.swingx.JXTable();
        btnThemSPNhap = new org.jdesktop.swingx.JXButton();
        btnXoaSPNhap = new org.jdesktop.swingx.JXButton();
        btnNhapSP = new org.jdesktop.swingx.JXButton();
        jXLabel11 = new org.jdesktop.swingx.JXLabel();
        txtTongTienNhapSP = new org.jdesktop.swingx.JXTextField();
        jXLabel32 = new org.jdesktop.swingx.JXLabel();
        jXLabel33 = new org.jdesktop.swingx.JXLabel();
        jXLabel34 = new org.jdesktop.swingx.JXLabel();
        jXLabel35 = new org.jdesktop.swingx.JXLabel();
        jXLabel36 = new org.jdesktop.swingx.JXLabel();
        txtMaPhieuNhap = new org.jdesktop.swingx.JXTextField();
        txtKieuSanPham = new org.jdesktop.swingx.JXTextField();
        txtLoaiSanPham = new org.jdesktop.swingx.JXTextField();
        txtSoLuongTon = new org.jdesktop.swingx.JXTextField();
        txtMaSanPhamNhap = new org.jdesktop.swingx.JXTextField();
        jXPanel2 = new org.jdesktop.swingx.JXPanel();
        jXLabel12 = new org.jdesktop.swingx.JXLabel();
        jXLabel13 = new org.jdesktop.swingx.JXLabel();
        jXLabel14 = new org.jdesktop.swingx.JXLabel();
        txtMaKhach = new org.jdesktop.swingx.JXTextField();
        txtTenKhach = new org.jdesktop.swingx.JXTextField();
        txtDiaChi = new org.jdesktop.swingx.JXTextField();
        jXLabel19 = new org.jdesktop.swingx.JXLabel();
        txtDonGiaMua = new org.jdesktop.swingx.JXTextField();
        jXLabel20 = new org.jdesktop.swingx.JXLabel();
        txtSoLuongMua = new org.jdesktop.swingx.JXTextField();
        txtThanhTienMua = new org.jdesktop.swingx.JXTextField();
        jXLabel21 = new org.jdesktop.swingx.JXLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblMuaHang = new org.jdesktop.swingx.JXTable();
        jXLabel22 = new org.jdesktop.swingx.JXLabel();
        txtTongTienMua = new org.jdesktop.swingx.JXTextField();
        btnThemSPMua = new org.jdesktop.swingx.JXButton();
        btnXoaSpMua = new org.jdesktop.swingx.JXButton();
        btnMuaSP = new org.jdesktop.swingx.JXButton();
        jXLabel37 = new org.jdesktop.swingx.JXLabel();
        txtMaPhieuMua = new org.jdesktop.swingx.JXTextField();
        jXLabel38 = new org.jdesktop.swingx.JXLabel();
        txtMaSanPhamMua = new org.jdesktop.swingx.JXTextField();
        jXLabel39 = new org.jdesktop.swingx.JXLabel();
        txtKieuSanPhamMua = new org.jdesktop.swingx.JXTextField();
        jXLabel40 = new org.jdesktop.swingx.JXLabel();
        txtLoaiSanPhamMua = new org.jdesktop.swingx.JXTextField();
        jXPanel3 = new org.jdesktop.swingx.JXPanel();
        jXLabel23 = new org.jdesktop.swingx.JXLabel();
        cbThongTinTimKiemSanPham = new org.jdesktop.swingx.JXComboBox();
        jXLabel24 = new org.jdesktop.swingx.JXLabel();
        txtThongTinTraCuuSP = new org.jdesktop.swingx.JXTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        tblTraCuu = new org.jdesktop.swingx.JXTable();
        btnTimSanPham = new org.jdesktop.swingx.JXButton();
        jXLabel25 = new org.jdesktop.swingx.JXLabel();
        jXLabel26 = new org.jdesktop.swingx.JXLabel();
        jXLabel27 = new org.jdesktop.swingx.JXLabel();
        jXLabel28 = new org.jdesktop.swingx.JXLabel();
        jXLabel29 = new org.jdesktop.swingx.JXLabel();
        btnXoaKhoanPhiQL = new org.jdesktop.swingx.JXButton();
        btnSuaPhiChi = new org.jdesktop.swingx.JXButton();
        txtKieuSanPhamQL = new org.jdesktop.swingx.JXTextField();
        txtLoaiSPQL = new org.jdesktop.swingx.JXTextField();
        txtMaSPQL = new org.jdesktop.swingx.JXTextField();
        txtTenSPQL = new org.jdesktop.swingx.JXTextField();
        txtDonGiaBanQL = new org.jdesktop.swingx.JXTextField();
        btnThemSPQL = new org.jdesktop.swingx.JXButton();
        jXPanel4 = new org.jdesktop.swingx.JXPanel();
        jXLabel30 = new org.jdesktop.swingx.JXLabel();
        cbThongTinTraCuuPhieuMuaHang = new org.jdesktop.swingx.JXComboBox();
        jXLabel31 = new org.jdesktop.swingx.JXLabel();
        txtThongTinTraCuuPhieuMuaHang = new org.jdesktop.swingx.JXTextField();
        btnTimPhieuMuaHang = new org.jdesktop.swingx.JXButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        tbTraCuuPhieuMua = new org.jdesktop.swingx.JXTable();

        jTabbedPane1.setBackground(new java.awt.Color(204, 204, 255));

        jXPanel1.setBackground(new java.awt.Color(204, 204, 255));

        jXLabel1.setText("Ngày Nhập:");

        jXLabel2.setText("Nguồn Nhập:");

        jXLabel3.setText("Địa Chỉ:");

        txtDiaChiNguonNhap.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        jXLabel6.setText("Số Lượng:");

        jXLabel7.setText("Đơn Giá Nhập:");

        jXLabel8.setText("Thành Tiền:");

        txtSoLuongNhap.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtSoLuongNhapKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtDonGiaNhapKeyTyped(evt);
            }
        });

        txtDonGiaNhap.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtDonGiaNhapKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtDonGiaNhapKeyTyped1(evt);
            }
        });

        txtThanhTienNhap.setEnabled(false);

        tblNhapHang.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Mã Sản Phẩm", "Số Lượng Nhập", "Đơn Giá Nhập", "Thành Tiền"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tblNhapHang.setColumnControlVisible(true);
        tblNhapHang.getTableHeader().setResizingAllowed(false);
        tblNhapHang.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(tblNhapHang);

        btnThemSPNhap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/add.png"))); // NOI18N
        btnThemSPNhap.setText("Thêm");
        btnThemSPNhap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnThemSPNhapActionPerformed(evt);
            }
        });

        btnXoaSPNhap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/exit.png"))); // NOI18N
        btnXoaSPNhap.setText("Xóa");
        btnXoaSPNhap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnXoaSPNhapActionPerformed(evt);
            }
        });

        btnNhapSP.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/insert.png"))); // NOI18N
        btnNhapSP.setText("Nhập");

        jXLabel11.setText("Tổng Tiền:");

        txtTongTienNhapSP.setEnabled(false);

        jXLabel32.setText("Mã Phiếu Nhập:");

        jXLabel33.setText("Mã Sản Phẩm:");

        jXLabel34.setText("Kiểu Sản Phẩm:");

        jXLabel35.setText("Loại Sản Phẩm:");

        jXLabel36.setText("Số Lượng:");

        txtMaPhieuNhap.setEnabled(false);

        txtKieuSanPham.setEnabled(false);

        txtLoaiSanPham.setEnabled(false);

        txtSoLuongTon.setEnabled(false);

        javax.swing.GroupLayout jXPanel1Layout = new javax.swing.GroupLayout(jXPanel1);
        jXPanel1.setLayout(jXPanel1Layout);
        jXPanel1Layout.setHorizontalGroup(
            jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel1Layout.createSequentialGroup()
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jXLabel32, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel33, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel34, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel35, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel36, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel1Layout.createSequentialGroup()
                                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtMaPhieuNhap, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(txtSoLuongTon, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                                        .addComponent(txtLoaiSanPham, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtKieuSanPham, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jXPanel1Layout.createSequentialGroup()
                                .addComponent(txtMaSanPhamNhap, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel1Layout.createSequentialGroup()
                                .addComponent(jXLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNguonNhap, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jXLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jXPanel1Layout.createSequentialGroup()
                                .addGap(104, 104, 104)
                                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jXLabel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jXLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jXLabel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtDonGiaNhap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtThanhTienNhap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtSoLuongNhap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtDiaChiNguonNhap, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnThemSPNhap, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnXoaSPNhap, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnNhapSP, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(63, 63, 63))))
                    .addGroup(jXPanel1Layout.createSequentialGroup()
                        .addComponent(jXLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(dtpNgayNhap, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
                        .addGap(583, 583, 583))))
            .addGroup(jXPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 760, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel1Layout.createSequentialGroup()
                        .addComponent(jXLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtTongTienNhapSP, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24)))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jXPanel1Layout.setVerticalGroup(
            jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtNguonNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(dtpNgayNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jXPanel1Layout.createSequentialGroup()
                            .addGap(3, 3, 3)
                            .addComponent(jXLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(txtDiaChiNguonNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jXPanel1Layout.createSequentialGroup()
                        .addComponent(jXLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)))
                .addGap(32, 32, 32)
                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel1Layout.createSequentialGroup()
                        .addComponent(btnThemSPNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnXoaSPNhap, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnNhapSP, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jXPanel1Layout.createSequentialGroup()
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtDonGiaNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jXLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMaPhieuNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(24, 24, 24)
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtSoLuongNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMaSanPhamNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtThanhTienNhap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jXLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtKieuSanPham, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel35, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtLoaiSanPham, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel36, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtSoLuongTon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(28, 28, 28)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTongTienNhapSP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(323, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Nhập Sản Phẩm", jXPanel1);

        jXPanel2.setBackground(new java.awt.Color(204, 204, 255));

        jXLabel12.setText("Mã Khách:");

        jXLabel13.setText("Tên Khách:");

        jXLabel14.setText("Địa Chỉ:");

        txtTenKhach.setEnabled(false);

        txtDiaChi.setEnabled(false);

        jXLabel19.setText("Đơn Giá Mua:");

        jXLabel20.setText("Số Lượng:");

        txtSoLuongMua.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtSoLuongMuaKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtSoLuongMuaKeyTyped(evt);
            }
        });

        txtThanhTienMua.setEnabled(false);

        jXLabel21.setText("Thành Tiền:");

        tblMuaHang.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Mã Sản Phẩm", "Đơn Giá Mua", "Số Lượng Mua", "Thành Tiền"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tblMuaHang.setColumnControlVisible(true);
        tblMuaHang.getTableHeader().setResizingAllowed(false);
        tblMuaHang.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tblMuaHang);

        jXLabel22.setText("Tổng Tiền:");

        txtTongTienMua.setEnabled(false);

        btnThemSPMua.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/add.png"))); // NOI18N
        btnThemSPMua.setText("Thêm");
        btnThemSPMua.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnThemSPMuaActionPerformed(evt);
            }
        });

        btnXoaSpMua.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/exit.png"))); // NOI18N
        btnXoaSpMua.setText("Xóa");
        btnXoaSpMua.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnXoaSpMuaActionPerformed(evt);
            }
        });

        btnMuaSP.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/money.png"))); // NOI18N
        btnMuaSP.setText("Mua");

        jXLabel37.setText("Mã Phiếu Nhập:");

        txtMaPhieuMua.setEnabled(false);

        jXLabel38.setText("Mã Sản Phẩm:");

        jXLabel39.setText("Kiểu Sản Phẩm:");

        txtKieuSanPhamMua.setEnabled(false);

        jXLabel40.setText("Loại Sản Phẩm:");

        txtLoaiSanPhamMua.setEnabled(false);

        javax.swing.GroupLayout jXPanel2Layout = new javax.swing.GroupLayout(jXPanel2);
        jXPanel2.setLayout(jXPanel2Layout);
        jXPanel2Layout.setHorizontalGroup(
            jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel2Layout.createSequentialGroup()
                .addGap(62, 62, 62)
                .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel2Layout.createSequentialGroup()
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jXLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel40, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtMaSanPhamMua, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtKieuSanPhamMua, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtLoaiSanPhamMua, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(txtMaKhach, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtMaPhieuMua, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(158, 158, 158)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jXLabel20, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel19, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jXLabel21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jXPanel2Layout.createSequentialGroup()
                        .addComponent(jXLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(121, 121, 121)
                        .addComponent(jXLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtTenKhach, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jXLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel2Layout.createSequentialGroup()
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtDonGiaMua, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                            .addComponent(txtThanhTienMua, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                            .addComponent(txtSoLuongMua, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 79, Short.MAX_VALUE)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnThemSPMua, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnXoaSpMua, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(txtDiaChi, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(32, 32, 32))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel2Layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 739, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(21, 21, 21))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel2Layout.createSequentialGroup()
                        .addComponent(jXLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(txtTongTienMua, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(43, 43, 43))))
            .addGroup(jXPanel2Layout.createSequentialGroup()
                .addGap(346, 346, 346)
                .addComponent(btnMuaSP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jXPanel2Layout.setVerticalGroup(
            jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel2Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtMaKhach, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTenKhach, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDiaChi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(19, 19, 19)
                .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel2Layout.createSequentialGroup()
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel2Layout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(jXLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(24, 24, 24)
                                .addComponent(jXLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jXPanel2Layout.createSequentialGroup()
                                .addComponent(txtDonGiaMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(txtSoLuongMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(23, 23, 23)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtThanhTienMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel2Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnThemSPMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)
                        .addComponent(btnXoaSpMua, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(42, 42, 42))
                    .addGroup(jXPanel2Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMaPhieuMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(24, 24, 24)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMaSanPhamMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtKieuSanPhamMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jXLabel40, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtLoaiSanPhamMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(30, 30, 30)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTongTienMua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(4, 4, 4)
                .addComponent(btnMuaSP, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(328, 328, 328))
        );

        jTabbedPane1.addTab("Mua Sản Phẩm", jXPanel2);

        jXPanel3.setBackground(new java.awt.Color(204, 204, 255));

        jXLabel23.setText("Tra Cứu Theo:");

        cbThongTinTimKiemSanPham.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tất Cả", "Kiểu Sản Phẩm", "Loại Sản Phẩm", "Mã Sản Phẩm", "Tên Sản Phẩm" }));

        jXLabel24.setText("Thông Tin Tra Cứu:");

        tblTraCuu.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Kiểu Sản Phẩm", "Loại Sản Phẩm", "Mã Sản Phẩm", "Tên Sản Phẩm", "Đơn Giá Bán", "Số Lượng"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tblTraCuu.setColumnControlVisible(true);
        tblTraCuu.getTableHeader().setResizingAllowed(false);
        tblTraCuu.getTableHeader().setReorderingAllowed(false);
        tblTraCuu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblTraCuuMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tblTraCuu);

        btnTimSanPham.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/find.png"))); // NOI18N
        btnTimSanPham.setText("Tìm");

        jXLabel25.setText("Kiểu Sản Phẩm:");

        jXLabel26.setText("Loại Sản Phẩm:");

        jXLabel27.setText("Mã Sản Phẩm:");

        jXLabel28.setText("Tên Sản Phẩm:");

        jXLabel29.setText("Đơn Giá Bán:");

        btnXoaKhoanPhiQL.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/exit.png"))); // NOI18N
        btnXoaKhoanPhiQL.setText("Xóa");

        btnSuaPhiChi.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/security2.png"))); // NOI18N
        btnSuaPhiChi.setText("Cập Nhật");

        txtMaSPQL.setEnabled(false);

        txtDonGiaBanQL.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtDonGiaBanQLKeyTyped(evt);
            }
        });

        btnThemSPQL.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/add.png"))); // NOI18N
        btnThemSPQL.setText("Thêm");

        javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3);
        jXPanel3.setLayout(jXPanel3Layout);
        jXPanel3Layout.setHorizontalGroup(
            jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel3Layout.createSequentialGroup()
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addGap(31, 31, 31)
                        .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 758, Short.MAX_VALUE)
                            .addGroup(jXPanel3Layout.createSequentialGroup()
                                .addComponent(jXLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(cbThongTinTimKiemSanPham, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(76, 76, 76)
                                .addComponent(jXLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(txtThongTinTraCuuSP, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnTimSanPham, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))))
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addGap(50, 50, 50)
                        .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jXPanel3Layout.createSequentialGroup()
                                .addComponent(jXLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtLoaiSPQL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(jXPanel3Layout.createSequentialGroup()
                                .addComponent(jXLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtKieuSanPhamQL, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(72, 72, 72)
                        .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel3Layout.createSequentialGroup()
                                .addGap(4, 4, 4)
                                .addComponent(jXLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jXLabel28, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtTenSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jXPanel3Layout.createSequentialGroup()
                                .addComponent(txtMaSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(59, 59, 59)
                                .addComponent(jXLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtDonGiaBanQL, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel3Layout.createSequentialGroup()
                        .addGap(152, 152, 152)
                        .addComponent(btnThemSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(71, 71, 71)
                        .addComponent(btnSuaPhiChi, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(78, 78, 78)
                        .addComponent(btnXoaKhoanPhiQL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(125, 125, 125)))
                .addContainerGap())
        );
        jXPanel3Layout.setVerticalGroup(
            jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel3Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbThongTinTimKiemSanPham, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtThongTinTraCuuSP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnTimSanPham, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(34, 34, 34)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34)
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtKieuSanPhamQL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtMaSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtDonGiaBanQL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtLoaiSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTenSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(47, 47, 47)
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSuaPhiChi, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnXoaKhoanPhiQL, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnThemSPQL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(293, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Tra Cứu Sản Phẩm", jXPanel3);

        jXPanel4.setBackground(new java.awt.Color(204, 204, 255));

        jXLabel30.setText("Tra Cứu Theo:");

        cbThongTinTraCuuPhieuMuaHang.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tất Cả", "Ngày Mua", "Tổng Tiền Mua", "Tên Khách Hàng", "Mã Sản Phẩm", " " }));

        jXLabel31.setText("Thông Tin Tra Cứu:");

        btnTimPhieuMuaHang.setIcon(new javax.swing.ImageIcon(getClass().getResource("/qlvbdq/images/find.png"))); // NOI18N
        btnTimPhieuMuaHang.setText("Tìm");

        tbTraCuuPhieuMua.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Mã Phiếu", "Mã Khách", "Ngày Mua", "Mã Sản Phẩm", "Số Lượng", "Tổng Tiền"
            }
        ));
        tbTraCuuPhieuMua.setColumnControlVisible(true);
        tbTraCuuPhieuMua.setHorizontalScrollEnabled(true);
        jScrollPane4.setViewportView(tbTraCuuPhieuMua);

        javax.swing.GroupLayout jXPanel4Layout = new javax.swing.GroupLayout(jXPanel4);
        jXPanel4.setLayout(jXPanel4Layout);
        jXPanel4Layout.setHorizontalGroup(
            jXPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel4Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addComponent(jXLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cbThongTinTraCuuPhieuMuaHang, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(76, 76, 76)
                .addComponent(jXLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(txtThongTinTraCuuPhieuMuaHang, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnTimPhieuMuaHang, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(jXPanel4Layout.createSequentialGroup()
                .addGap(61, 61, 61)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 656, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jXPanel4Layout.setVerticalGroup(
            jXPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel4Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(jXPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbThongTinTraCuuPhieuMuaHang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jXLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtThongTinTraCuuPhieuMuaHang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnTimPhieuMuaHang, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(270, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Danh Sách Phiếu Mua Hàng", jXPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txtDonGiaNhapKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDonGiaNhapKeyTyped
        char key = evt.getKeyChar();
        if(key < '0'  || key > '9')
            evt.consume();
    }//GEN-LAST:event_txtDonGiaNhapKeyTyped

    private void txtSoLuongMuaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSoLuongMuaKeyTyped
        // TODO add your handling code here:
      if(!Character.isDigit(evt.getKeyChar()))
           evt.consume();
    }//GEN-LAST:event_txtSoLuongMuaKeyTyped

    private void txtDonGiaNhapKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDonGiaNhapKeyPressed
       
       if(txtDonGiaNhap.getText().length() == 10)
           evt.consume();
    }//GEN-LAST:event_txtDonGiaNhapKeyPressed

    private void btnThemSPNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnThemSPNhapActionPerformed
        DefaultTableModel model = (DefaultTableModel) tblNhapHang.getModel();
        model.addRow(new Object[]{txtMaSanPhamNhap.getText(),txtSoLuongNhap.getText(),txtDonGiaNhap.getText(),txtThanhTienNhap.getText()});
        ClearTextField();
    }//GEN-LAST:event_btnThemSPNhapActionPerformed

    private void btnXoaSPNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXoaSPNhapActionPerformed
       DefaultTableModel model = (DefaultTableModel) tblNhapHang.getModel();
       model.removeRow(tblNhapHang.getSelectedRow());
    }//GEN-LAST:event_btnXoaSPNhapActionPerformed

    private void txtDonGiaNhapKeyTyped1(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDonGiaNhapKeyTyped1
        if(!Character.isDigit(evt.getKeyChar()))
           evt.consume();
    }//GEN-LAST:event_txtDonGiaNhapKeyTyped1

    private void btnThemSPMuaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnThemSPMuaActionPerformed
        DefaultTableModel model = (DefaultTableModel) tblMuaHang.getModel();
        model.addRow(new Object[]{txtMaSanPhamMua.getText(),txtDonGiaMua.getText(),txtSoLuongMua.getText(),txtThanhTienMua.getText()});
        ClearTextField();
    }//GEN-LAST:event_btnThemSPMuaActionPerformed

    private void btnXoaSpMuaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXoaSpMuaActionPerformed
        DefaultTableModel model = (DefaultTableModel) tblMuaHang.getModel();
        model.removeRow(tblMuaHang.getSelectedRow());
    }//GEN-LAST:event_btnXoaSpMuaActionPerformed

    private void txtSoLuongNhapKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSoLuongNhapKeyPressed
        if(evt.getKeyChar() == KeyEvent.VK_ENTER)
            btnThemSPNhapActionPerformed(null);
    }//GEN-LAST:event_txtSoLuongNhapKeyPressed

    private void tblTraCuuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblTraCuuMouseClicked
        DefaultTableModel model = (DefaultTableModel)tblTraCuu.getModel();
        txtDonGiaBanQL.setText(model.getValueAt(tblTraCuu.getSelectedRow(), 4).toString());
        txtTenSPQL.setText(model.getValueAt(tblTraCuu.getSelectedRow(), 3).toString());
        txtKieuSanPhamQL.setText(model.getValueAt(tblTraCuu.getSelectedRow(), 0).toString());
        txtLoaiSPQL.setText(model.getValueAt(tblTraCuu.getSelectedRow(), 1).toString());
        txtMaSPQL.setText(model.getValueAt(tblTraCuu.getSelectedRow(), 2).toString());
    }//GEN-LAST:event_tblTraCuuMouseClicked

    private void txtSoLuongMuaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSoLuongMuaKeyPressed
      if(evt.getKeyChar() == KeyEvent.VK_ENTER)
          btnThemSPMuaActionPerformed(null);
    }//GEN-LAST:event_txtSoLuongMuaKeyPressed

    private void txtDonGiaBanQLKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDonGiaBanQLKeyTyped
        if(!Character.isDigit(evt.getKeyChar()))
           evt.consume();
    }//GEN-LAST:event_txtDonGiaBanQLKeyTyped


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXButton btnMuaSP;
    private org.jdesktop.swingx.JXButton btnNhapSP;
    private org.jdesktop.swingx.JXButton btnSuaPhiChi;
    private org.jdesktop.swingx.JXButton btnThemSPMua;
    private org.jdesktop.swingx.JXButton btnThemSPNhap;
    private org.jdesktop.swingx.JXButton btnThemSPQL;
    private org.jdesktop.swingx.JXButton btnTimPhieuMuaHang;
    private org.jdesktop.swingx.JXButton btnTimSanPham;
    private org.jdesktop.swingx.JXButton btnXoaKhoanPhiQL;
    private org.jdesktop.swingx.JXButton btnXoaSPNhap;
    private org.jdesktop.swingx.JXButton btnXoaSpMua;
    private org.jdesktop.swingx.JXComboBox cbThongTinTimKiemSanPham;
    private org.jdesktop.swingx.JXComboBox cbThongTinTraCuuPhieuMuaHang;
    private org.jdesktop.swingx.JXDatePicker dtpNgayNhap;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private org.jdesktop.swingx.JXLabel jXLabel1;
    private org.jdesktop.swingx.JXLabel jXLabel11;
    private org.jdesktop.swingx.JXLabel jXLabel12;
    private org.jdesktop.swingx.JXLabel jXLabel13;
    private org.jdesktop.swingx.JXLabel jXLabel14;
    private org.jdesktop.swingx.JXLabel jXLabel19;
    private org.jdesktop.swingx.JXLabel jXLabel2;
    private org.jdesktop.swingx.JXLabel jXLabel20;
    private org.jdesktop.swingx.JXLabel jXLabel21;
    private org.jdesktop.swingx.JXLabel jXLabel22;
    private org.jdesktop.swingx.JXLabel jXLabel23;
    private org.jdesktop.swingx.JXLabel jXLabel24;
    private org.jdesktop.swingx.JXLabel jXLabel25;
    private org.jdesktop.swingx.JXLabel jXLabel26;
    private org.jdesktop.swingx.JXLabel jXLabel27;
    private org.jdesktop.swingx.JXLabel jXLabel28;
    private org.jdesktop.swingx.JXLabel jXLabel29;
    private org.jdesktop.swingx.JXLabel jXLabel3;
    private org.jdesktop.swingx.JXLabel jXLabel30;
    private org.jdesktop.swingx.JXLabel jXLabel31;
    private org.jdesktop.swingx.JXLabel jXLabel32;
    private org.jdesktop.swingx.JXLabel jXLabel33;
    private org.jdesktop.swingx.JXLabel jXLabel34;
    private org.jdesktop.swingx.JXLabel jXLabel35;
    private org.jdesktop.swingx.JXLabel jXLabel36;
    private org.jdesktop.swingx.JXLabel jXLabel37;
    private org.jdesktop.swingx.JXLabel jXLabel38;
    private org.jdesktop.swingx.JXLabel jXLabel39;
    private org.jdesktop.swingx.JXLabel jXLabel40;
    private org.jdesktop.swingx.JXLabel jXLabel6;
    private org.jdesktop.swingx.JXLabel jXLabel7;
    private org.jdesktop.swingx.JXLabel jXLabel8;
    private org.jdesktop.swingx.JXPanel jXPanel1;
    private org.jdesktop.swingx.JXPanel jXPanel2;
    private org.jdesktop.swingx.JXPanel jXPanel3;
    private org.jdesktop.swingx.JXPanel jXPanel4;
    private org.jdesktop.swingx.JXTable tbTraCuuPhieuMua;
    private org.jdesktop.swingx.JXTable tblMuaHang;
    private org.jdesktop.swingx.JXTable tblNhapHang;
    private org.jdesktop.swingx.JXTable tblTraCuu;
    private org.jdesktop.swingx.JXTextField txtDiaChi;
    private org.jdesktop.swingx.JXTextField txtDiaChiNguonNhap;
    private org.jdesktop.swingx.JXTextField txtDonGiaBanQL;
    private org.jdesktop.swingx.JXTextField txtDonGiaMua;
    private org.jdesktop.swingx.JXTextField txtDonGiaNhap;
    private org.jdesktop.swingx.JXTextField txtKieuSanPham;
    private org.jdesktop.swingx.JXTextField txtKieuSanPhamMua;
    private org.jdesktop.swingx.JXTextField txtKieuSanPhamQL;
    private org.jdesktop.swingx.JXTextField txtLoaiSPQL;
    private org.jdesktop.swingx.JXTextField txtLoaiSanPham;
    private org.jdesktop.swingx.JXTextField txtLoaiSanPhamMua;
    private org.jdesktop.swingx.JXTextField txtMaKhach;
    private org.jdesktop.swingx.JXTextField txtMaPhieuMua;
    private org.jdesktop.swingx.JXTextField txtMaPhieuNhap;
    private org.jdesktop.swingx.JXTextField txtMaSPQL;
    private org.jdesktop.swingx.JXTextField txtMaSanPhamMua;
    private org.jdesktop.swingx.JXTextField txtMaSanPhamNhap;
    private org.jdesktop.swingx.JXTextField txtNguonNhap;
    private org.jdesktop.swingx.JXTextField txtSoLuongMua;
    private org.jdesktop.swingx.JXTextField txtSoLuongNhap;
    private org.jdesktop.swingx.JXTextField txtSoLuongTon;
    private org.jdesktop.swingx.JXTextField txtTenKhach;
    private org.jdesktop.swingx.JXTextField txtTenSPQL;
    private org.jdesktop.swingx.JXTextField txtThanhTienMua;
    private org.jdesktop.swingx.JXTextField txtThanhTienNhap;
    private org.jdesktop.swingx.JXTextField txtThongTinTraCuuPhieuMuaHang;
    private org.jdesktop.swingx.JXTextField txtThongTinTraCuuSP;
    private org.jdesktop.swingx.JXTextField txtTongTienMua;
    private org.jdesktop.swingx.JXTextField txtTongTienNhapSP;
    // End of variables declaration//GEN-END:variables
}
